package com.bjpowernode.service.impl;

import com.bjpowernode.entity.TPermission;
import com.bjpowernode.mapper.TPermissionMapper;
import com.bjpowernode.service.PermissionService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 权限服务实现类，负责处理权限相关的业务逻辑
 */
@Service
public class PermissionServiceImpl implements PermissionService {
    /**
     * 权限数据访问对象，用于数据库操作
     */
    @Resource
    private TPermissionMapper tPermissionMapper;

    /**
     * 根据用户ID获取权限列表
     * @param id 用户ID
     * @return 权限列表，包含用户可访问的菜单权限信息
     */
    @Override
    public List<TPermission> getPermissionByUserId(Integer id) {
        List<TPermission> tPermissionList = tPermissionMapper.selectMenuPermissionListByUserId(id);
        return tPermissionList;
    }
}
